Skip to content

feat(diskann): add macOS POSIX AIO support#605

Closed
iaojnh wants to merge 87 commits into
alibaba:mainfrom
iaojnh:feat/diskann-macos
Closed

feat(diskann): add macOS POSIX AIO support#605
iaojnh wants to merge 87 commits into
alibaba:mainfrom
iaojnh:feat/diskann-macos

Conversation

@iaojnh

@iaojnh iaojnh commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Relationship to #557

This PR supersedes #557 and contains its head commit. It preserves the Linux support introduced there, while updating the branch to the current main and replacing the macOS I/O prototype with a complete POSIX AIO implementation.

The main difference is the role of kqueue:

  • feat(diskann): add macOS support via kqueue-based async IO #557 registered the regular file descriptor with EVFILT_READ, but still executed every read synchronously using pread(). Therefore, kqueue acted only as a readiness wrapper and did not provide asynchronous disk I/O.
  • This PR submits actual asynchronous requests with aio_read() and uses SIGEV_KEVENT / EVFILT_AIO through kevent64() for completion notification.

The new implementation batches requests, validates every completion, safely drains outstanding AIO operations on failure, and falls back to synchronous pread() when POSIX AIO or kqueue cannot be used.

It also limits this path explicitly to macOS, exposes POSIX_AIO as a distinct backend through the C and Python APIs, and adds tests that verify both the actual POSIX AIO path and the synchronous fallback.

iaojnh added 10 commits July 17, 2026 12:04
# Conflicts:
#	.github/workflows/03-macos-linux-build.yml
#	.github/workflows/nightly_coverage.yml
#	CMakeLists.txt
#	examples/c++/CMakeLists.txt
#	python/tests/detail/fixture_helper.py
#	python/tests/test_collection_diskann.py
#	python/zvec/__init__.py
#	src/binding/python/model/common/python_config.cc
#	src/core/CMakeLists.txt
#	src/core/algorithm/diskann/CMakeLists.txt
#	src/core/algorithm/diskann/diskann_builder.cc
#	src/core/algorithm/diskann/diskann_file_reader.cc
#	src/core/algorithm/diskann/diskann_file_reader.h
#	src/core/algorithm/diskann/diskann_searcher.cc
#	src/core/algorithm/diskann/diskann_streamer.cc
#	src/db/index/common/schema.cc
@iaojnh iaojnh changed the title Feat/diskann macos feat(diskann): add macOS POSIX AIO with kqueue completion Jul 20, 2026
@iaojnh
iaojnh marked this pull request as ready for review July 20, 2026 13:18
@iaojnh iaojnh changed the title feat(diskann): add macOS POSIX AIO with kqueue completion feat(diskann): add macOS POSIX AIO support Jul 21, 2026
@iaojnh
iaojnh marked this pull request as draft July 24, 2026 08:41
@iaojnh iaojnh closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants